Skip to content

redis timeseries support #1652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 28, 2021
Merged

redis timeseries support #1652

merged 2 commits into from
Oct 28, 2021

Conversation

chayim
Copy link
Contributor

@chayim chayim commented Oct 26, 2021

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Please provide a description of the change here.

@chayim chayim merged commit eaa56b7 into redis:master Oct 28, 2021
@ceng-p
Copy link

ceng-p commented Nov 29, 2021

How can I access redistimeseries commands from a RedisCluster client?

I tried using .execute_command() with the following errors

E redis.exceptions.RedisClusterException: No way to dispatch this command to Redis Cluster. Missing key.
E You can execute the command by specifying target nodes.
E Command: ('TS.MRANGE', 1637362800000, 1637794800000, 'FILTER', 'key=example')

@chayim
Copy link
Contributor Author

chayim commented Nov 29, 2021

@98christianp Does your cluster have the redistimeseries module installed? Also, what version of the client are you using, have you tried 4.1.0rc1?

@ceng-p
Copy link

ceng-p commented Nov 30, 2021

Hey @chayim thanks for getting back 😄 I'm on 4.1.0rc1 and I got it working by adding the argument target_nodes="all"to .execute_command()

I've noticed the TimeSeries commands only work for a regular client and not rediscluster, i.e

from redis.cluster import RedisCluster
from redis.commands.timeseries import TimeSeries

redis_db = RedisCluster.from_url()
ts = TimeSeries(redis_db)

will throw an error

Maybe I should specify in an issue instead? Thanks

@chayim chayim deleted the ck-timeseries branch December 15, 2021 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants